Imports MIMS_WRS.Business

Public Class ProductCodeListDialog
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents repProCode As System.Web.UI.WebControls.Repeater

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Protected ReadOnly Property CustomerID() As Integer
        Get
            Dim id As Integer

            Try
                id = CInt(Request.QueryString("cid"))
            Catch ex As Exception
                id = 0
            End Try

            If Not (id > 0) Then
                Throw New ApplicationException("Invalid or missing parameter")
            End If

            Return id
        End Get
    End Property

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If (Not Me.IsPostBack) Then
            Me.repProCode.DataSource = CProductCode.GetProductCodeList(Me.CustomerID)
            Me.repProCode.DataBind()
        End If
    End Sub

End Class
